<template>
  <view class="page black-ground invoice-detail-page">
    <div class="page-title">我的发票 My Invoice</div>

    <div class="wrap">
      <div class="tl">
        尼奥·劳赫 <br />
        Neo Rauch
      </div>
      <div class="mini">
        开票合计金额 Total invoicing amount <br />
        ¥ {{ info.money }}
      </div>
      <div class="mini">
        发票抬头 Invoice Title <br />
        ¥ {{ info.title }}
      </div>
      <div class="mini">
        纳税人识别号 Taxpayer Identification Number <br />
        ¥ {{ info.taxNum }}
      </div>
      <div class="mini">
        收票人邮箱 Receiver's Email <br />
        ¥ {{ info.email }}
      </div>
      <div class="mini">
        申请日期 Time <br />
        ¥ {{ info.createTime }}
      </div>
    </div>
  </view>
</template>
<script setup lang="ts">
import { ref, reactive, watch, computed } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { useStore } from 'vuex'
const store = useStore()
import { orderInvoiceDetails } from '@/utils/api/orderInvoice'

// 用来接受传过来的值
let id: string | number = ''
let info = ref<any | null>(null)
const loadData = async () => {
  let { code, data } = await orderInvoiceDetails({ id })
  if (code !== 200) return
  info.value = data
}
onLoad((opt) => {
  id = opt.id
  loadData()
})

onPullDownRefresh(() => {
  loadData()
})
</script>

<style lang="scss" scoped></style>
